<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/static/common/taglibs.jsp" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <meta name="author" content="jack"/>
    <meta name="keywords" content="网页描述"/>
    <meta name="description" content="网页关键字"/>
    <title>我的珠宝店</title>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/css/global.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/css/layout.css"/>
    <script type="text/javascript" src="${ctx}/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/global.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/myadmin.js"></script>
 <%--   <script type="application/javascript">
        function updatePassword() {
            var oldPassword = $("#odlPassword").val();
            var newPassword = $("#newPassword").val();
            var newPassword2 = $("#newPassword2").val();
            if (newPassword != newPassword2) {
                alert("确认密码与新密码不相同");
            } else {
                $.post("${ctx}/account/user/updatePassword", {oldPassword: oldPassword, newPassword: newPassword},
                        function (data) {
                            if (data != null) {
                                alert(data);
                            }
                        });
            }
        }

        function saveAddress() {
            var name = $("#shopAddress_name").val();
            var cell = $("#shopAddress_cell").val();
            var cellphone = $("#shopAddress_cellphone").val();
            var address = $("#shopAddress_address").val();
            var remark = $("#shopAddress_remark").val();
            var email = $("#shopAddress_email").val();
            var fax = $("#shopAddress_fax").val();
            $.post("${ctx}/address/save", {filter_name: name, filter_cell: cell,
                        filter_cellphone: cellphone, filter_address: address, filter_remark: remark, filter_email: email, filter_fax: fax},
                    function (data) {
                        alert(data);
//                        location.reload();
                    });
        }

        function searchOrder() {
            var orderNum = $("#orderNum");
            var orderStatus = $("#orderStatus");
            $.post("${ctx}/account/user/searchOrder", {filter_EQ_status: orderStatus.val(),
                        filter_EQ_orderNum: orderNum.val()},
                    function (data) {
                        $(data).replaceAll($("#orderTable"));
                    });
        }

        function deleteOrder(id) {
            if (confirm("确认要取消订单？")) {
                $.post("${ctx}/order/deleteOrder/", {id: id},
                        function (data) {
                            alert(data);
                            location.reload();
                            $("passwordDiv").removeClass(".cur");
                            $("orderDiv").addClass(".cur");
                        });
            }
        }
    </script>--%>
</head>
<body>
<div id="wrap" style="position:relative;">
    <div class="head">
        <div class="top">
            <h1><a href="${ctx}/index/toIndex"><img src="${ctx}/static/images/logo_head.jpg" alt=""/></a></h1>

            <div class="nav"><a href="${ctx}/index/toIndex"><img src="${ctx}/static/images/top_xtb.jpg" alt=""/>　挑选钻石/戒托</a>　|　<a href="${ctx}/account/user/">
                <img src="${ctx}/static/images/head_xtb1.jpg" alt=""/>　我的帐户</a>　|　
                <a href="${ctx}/ShopCart/"><img src="${ctx}/static/images/head_xtb2.jpg" alt=""/>　购物车 <b id="shopCartCount">0</b> 件</a>　|　
                <a href="${ctx}/logout"><img src="${ctx}/static/images/head_xtb3.jpg" alt=""/>　退出登录</a></div>
            <div class="del_float"></div>
        </div>
    </div>
    <div class="zuan_list">
        <h2>我的帐户</h2>

        <div class="myadmin">
            <div class="mynav">
                <a href="#" class="one" id="passwordDiv">修改密码</a>
                <a href="#" class="two cur" id="orderDiv">我的订单</a>
                <a href="#" class="three">收货信息</a>
            </div>
            <div class="rig rig1" style="display:none;">
                <h3>修改密码</h3>

                <div class="rig1_box">
                    <p><input type="text" name="odlPassword" id="odlPassword" class="put4"/></p>

                    <p><input type="text" name="newPassword" id="newPassword" class="put4"/></p>

                    <p><input type="text" name="newPassword2" id="newPassword2" class="put4"/></p>

                    <p style="padding:13px 0 0 215px;">
                        <a onClick="updatePassword()"><img src="${ctx}/static/images/myadmin_xiu_btn.jpg" alt=""/></a>
                    </p>
                </div>
            </div>
            <div class="rig rig2" >
                <h3>我的订单</h3>

                <div class="rig2_box">
                    <div class="search">
                        请输入订单号查询<input class="put5" type="text" id="orderNum"/>　
                        订单状态
                        <select class="put6" id="orderStatus">
                            <option value="">全部</option>
                            <option value="1">已处理</option>
                            <option value="0">未处理</option>
                        </select>
                        <input type="button" class="button" onClick="searchOrder()"/>
                    </div>
                    <table cellpadding="0" cellspacing="0" border="0" id="orderTable">
                        <tr>
                            <th width="120">订单号</th>
                            <th width="115">收货人</th>
                            <th width="120">联系方式</th>
                            <th width="92">价格</th>
                            <th width="92">订单状态</th>
                            <th width="103">订购时间</th>
                            <th width="135">常规操作</th>
                        </tr>

                        <c:forEach items="${orders}" var="order">
                            <tr>
                                <th width="120">${order.orderNum}</th>
                                <th width="115">${order.recieveUser}</th>
                                <th width="120">${order.phone}</th>
                                <th width="92"><fmt:formatNumber value="${order.sumPrice}" pattern="0"/></th>
                                <th width="92">
                                    <c:if test="${order.status==0}">
                                        未处理
                                    </c:if>
                                    <c:if test="${order.status==1}">
                                        已处理
                                    </c:if>
                                </th>
                                <th width="103"><fmt:formatDate value="${order.submitTime}" pattern="yyyy-MM-dd"/></th>
                                <th width="135"><a href="${ctx}/order/detail?id=${order.id}">查看详情</a>&nbsp;
                                    <a href="#" onClick="deleteOrder(${order.id})">取消订单</a></th>
                            </tr>
                        </c:forEach>
                    </table>
                    <p>注：订单状态为"未处理"时客户可自行取消订单</p>
                </div>
            </div>
            <div class="rig rig3" style="display:none;">
                <h3>收货信息</h3>

                <div class="rig3_box">
                    <p><input type="text" id="shopAddress_name" class="put4" value="${shopAddress.name}"/></p>

                    <p><input type="text" id="shopAddress_email" class="put4" value="${shopAddress.email}"/></p>

                    <p><input type="text" id="shopAddress_cell" class="put4" value="${shopAddress.cell}"/></p>

                    <p><input type="text" id="shopAddress_fax" class="put4" value="${shopAddress.fax}"/></p>

                    <p><input type="text" id="shopAddress_cellphone" class="put4" value="${shopAddress.cellphone}"/></p>

                    <p><input type="text" id="shopAddress_address" class="put4" value="${shopAddress.address}"
                              style="width:515px;"/></p>

                    <p style="padding:13px 0 0 130px;">
                        <a onClick="saveAddress()">
                            <img src="${ctx}/static/images/myadmin_xiu_btn.jpg" alt=""/>
                        </a>
                    </p>
                </div>
            </div>
            <div class="del_float"></div>
        </div>
    </div>
    <span id="ding_btn1"><a href="${ctx}/ShopCart/">购物车 <b id="shopCartCount2">0</b> 件</a></span>
	<span id="ding_btn2"><img src="/xipujewelWeb/static/images/ding_btn1-02.png"/></span>
    <div class="footer">© 2014 My jewelry store</div>
</div>
</body>
</html>